import { Link, useNavigate,useSearchParams,useParams } from 'react-router-dom'

const Article = () => {
const navigate=useNavigate()
// const [params]=useSearchParams()
// const id=params.get('id')
const param=useParams()
const id=param.id
const name=param.name
  return (
    <div>
      <div>我是文章页{id}-{name}</div>
      <Link to="/login">登录页</Link>
      <button onClick={()=>{navigate('/login')}}>登录页</button>
    </div>
  )
}
export default Article
